using DslDiagrams = global::Microsoft.VisualStudio.Modeling.Diagrams;
using DslModeling = global::Microsoft.VisualStudio.Modeling;

// Code to define the MultiLineCompartment shape.
// This code was originally generated - now standalone.

namespace Microsoft.Modeling.StoryboardDesigner
{
    /// <summary>
    /// DomainClass MultiLineCompartment
    /// Description for Microsoft.Modeling.StoryboardDesigner.MultiLineCompartment
    /// </summary>
    [global::System.CLSCompliant(true)]
    [DslModeling::DomainObjectId("8ad37eb8-c766-48a7-b062-cdfd86d8b917")]
    public partial class MultiLineCompartment : DslDiagrams::Compartment
    {
        #region DiagramElement boilerplate
        private static DslDiagrams::StyleSet classStyleSet;
        private static global::System.Collections.Generic.IList<DslDiagrams::ShapeField> shapeFields;
        private static global::System.Collections.Generic.IList<DslDiagrams::Decorator> decorators;

        /// <summary>
        /// Per-class style set for this shape.
        /// </summary>
        protected override DslDiagrams::StyleSet ClassStyleSet
        {
            get
            {
                if(classStyleSet == null)
                {
                    classStyleSet = CreateClassStyleSet();
                }

                return classStyleSet;
            }
        }

        /// <summary>
        /// Per-class ShapeFields for this shape.
        /// </summary>
        public override global::System.Collections.Generic.IList<DslDiagrams::ShapeField> ShapeFields
        {
            get
            {
                if(shapeFields == null)
                {
                    shapeFields = CreateShapeFields();
                }

                return shapeFields;
            }
        }

        /// <summary>
        /// Event fired when decorator initialization is complete for this shape type.
        /// </summary>
        public static event global::System.EventHandler DecoratorsInitialized;

        /// <summary>
        /// List containing decorators used by this type.
        /// </summary>
        public override global::System.Collections.Generic.IList<DslDiagrams::Decorator> Decorators
        {
            get
            {
                if(decorators == null)
                {
                    decorators = CreateDecorators();

                    // fire this event to allow the diagram to initialize decorator mappings for this shape type.
                    if(DecoratorsInitialized != null)
                    {
                        DecoratorsInitialized(this, global::System.EventArgs.Empty);
                    }
                }

                return decorators;
            }
        }

        /// <summary>
        /// Finds a decorator associated with MultiLineCompartment.
        /// </summary>
        public static DslDiagrams::Decorator FindMultiLineCompartmentDecorator(string decoratorName)
        {
            if(decorators == null)
            {
                return null;
            }

            return DslDiagrams::ShapeElement.FindDecorator(decorators, decoratorName);
        }

        #endregion
        #region Shape size

        /// <summary>
        /// Default size for this shape.
        /// </summary>
        public override DslDiagrams::SizeD DefaultSize
        {
            get
            {
                return new DslDiagrams::SizeD(1.5, 0.5);
            }
        }
        #endregion
        
        #region Shape styles
        /// <summary>
        /// Indicates whether this shape displays a background gradient.
        /// </summary>
        public override bool HasBackgroundGradient
        {
            get
            {
                return true;
            }
        }

        /// <summary>
        /// Indicates the direction of the gradient.
        /// </summary>
        public override global::System.Drawing.Drawing2D.LinearGradientMode BackgroundGradientMode
        {
            get
            {
                return global::System.Drawing.Drawing2D.LinearGradientMode.Horizontal;
            }
        }
        #endregion

        #region Constructors, domain class Id

        /// <summary>
        /// MultiLineCompartment domain class Id.
        /// </summary>
        public static readonly new global::System.Guid DomainClassId = new global::System.Guid(0x8ad37eb8, 0xc766, 0x48a7, 0xb0, 0x62, 0xcd, 0xfd, 0x86, 0xd8, 0xb9, 0x17);
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="store">Store where new element is to be created.</param>
        /// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
        public MultiLineCompartment(DslModeling::Store store, params DslModeling::PropertyAssignment[] propertyAssignments)
            : this(store != null ? store.DefaultPartition : null, propertyAssignments)
        {
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="partition">Partition where new element is to be created.</param>
        /// <param name="propertyAssignments">List of domain property id/value pairs to set once the element is created.</param>
        public MultiLineCompartment(DslModeling::Partition partition, params DslModeling::PropertyAssignment[] propertyAssignments)
            : base(partition, propertyAssignments)
        {
        }
        #endregion

        #region CustomDisplayProperty domain property code

        /// <summary>
        /// CustomDisplayProperty domain property Id.
        /// </summary>
        public static readonly global::System.Guid CustomDisplayPropertyDomainPropertyId = new global::System.Guid(0x860cf2aa, 0xe6ca, 0x4b6f, 0xa2, 0x06, 0x43, 0xc7, 0x04, 0x5b, 0x3a, 0xe7);

        /// <summary>
        /// Gets or sets the value of CustomDisplayProperty domain property.
        /// Description for Microsoft.Modeling.StoryboardDesigner.CommentBoxShape.Test Custom Property
        /// </summary>
        [global::System.ComponentModel.Browsable(false)]
        [DslModeling::DomainProperty(Kind = DslModeling::DomainPropertyKind.CustomStorage)]
        [DslModeling::DomainObjectId("860cf2aa-e6ca-4b6f-a206-43c7045b3ae7")]
        public global::System.String CustomDisplayProperty
        {
            [global::System.Diagnostics.DebuggerStepThrough]
            get
            {
                return CustomDisplayPropertyPropertyHandler.Instance.GetValue(this);
            }
            [global::System.Diagnostics.DebuggerStepThrough]
            set
            {
                CustomDisplayPropertyPropertyHandler.Instance.SetValue(this, value);
            }
        }
        /// <summary>
        /// Value handler for the CommentBoxShape.CustomDisplayProperty domain property.
        /// </summary>
        internal sealed partial class CustomDisplayPropertyPropertyHandler : DslModeling::DomainPropertyValueHandler<MultiLineCompartment, global::System.String>
        {
            private CustomDisplayPropertyPropertyHandler() { }

            /// <summary>
            /// Gets the singleton instance of the CommentBoxShape.CustomDisplayProperty domain property value handler.
            /// </summary>
            public static readonly CustomDisplayPropertyPropertyHandler Instance = new CustomDisplayPropertyPropertyHandler();

            /// <summary>
            /// Gets the Id of the CommentBoxShape.CustomDisplayProperty domain property.
            /// </summary>
            public sealed override global::System.Guid DomainPropertyId
            {
                [global::System.Diagnostics.DebuggerStepThrough]
                get
                {
                    return CustomDisplayPropertyDomainPropertyId;
                }
            }

            /// <summary>
            /// Gets a strongly-typed value of the property on specified element.
            /// </summary>
            /// <param name="element">Element which owns the property.</param>
            /// <returns>Property value.</returns>
            public override sealed global::System.String GetValue(MultiLineCompartment element)
            {
                if(element == null) throw new global::System.ArgumentNullException("element");
                // There is no storage for CustomDisplayProperty because its Kind is
                // set to CustomStorage. Please provide the GetCustomDisplayPropertyValue()
                // method on the domain class.
                return element.GetCustomDisplayPropertyValue();
            }

            /// <summary>
            /// Sets property value on an element.
            /// </summary>
            /// <param name="element">Element which owns the property.</param>
            /// <param name="newValue">New property value.</param>
            public override sealed void SetValue(MultiLineCompartment element, global::System.String newValue)
            {
                if(element == null) throw new global::System.ArgumentNullException("element");

                global::System.String oldValue = GetValue(element);
                if(newValue != oldValue)
                {
                    ValueChanging(element, oldValue, newValue);
                    // There is no storage for CustomDisplayProperty because its Kind is
                    // set to CustomStorage. Please provide the SetCustomDisplayPropertyValue()
                    // method on the domain class.
                    element.SetCustomDisplayPropertyValue(newValue);
                    ValueChanged(element, oldValue, GetValue(element));
                }
            }
        }

        #endregion
    }
}